package com.zs.usc.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.zs.usc.common.log.enums.LogTypes;
import com.zs.usc.common.log.enums.OperationTypes;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 日志
 * </p>
 *
 * @author ZS
 * @since 2021-12-11
 */
@TableName("usc_log")
@ApiModel(value = "LogInfo对象", description = "日志")
@Data
@ToString
public class LogInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "日志ID")
    @TableId(value = "log_Id", type = IdType.ASSIGN_ID)
    private String logId;

    @ApiModelProperty(value = "操作系统名称")
    @TableField("operate_System")
    private String operateSystem;

    @ApiModelProperty(value = "浏览器名称")
    @TableField("browser")
    private String browser;

    @ApiModelProperty(value = "请求IP")
    @TableField("ip")
    private String ip;

    @ApiModelProperty(value = "请求模块名称")
    @TableField("module_Name")
    private String moduleName;

    @ApiModelProperty(value = "请求方法名称")
    @TableField("method_Name")
    private String methodName;

    @ApiModelProperty(value = "请求方式")
    @TableField("request_Method")
    private String requestMethod;

    @ApiModelProperty(value = "请求URL")
    @TableField("request_Uri")
    private String requestUri;

    @ApiModelProperty(value = "操作类型")
    @TableField("operate_Type")
    private OperationTypes operateType;

    @ApiModelProperty(value = "请求参数")
    @TableField("request_Param")
    private String requestParam;

    @ApiModelProperty(value = "响应参数")
    @TableField("response_param")
    private String responseParam;

    @ApiModelProperty(value = "请求结果")
    @TableField("status_Code")
    private Integer statusCode;

    @ApiModelProperty(value = "请求结果描述")
    @TableField("status_Name")
    private String statusName;

    @ApiModelProperty(value = "异常信息")
    @TableField("exception_Message")
    private String exceptionMessage;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_Time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "请求账户")
    @TableField("User_Name")
    private String userName;

    @ApiModelProperty(value = "账户ID")
    @TableField("User_Id")
    private String userId;

    @ApiModelProperty(value = "日志类型")
    @TableField("log_Type")
    private LogTypes logType;

}
